#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
#define rep(i, a, b) for (int i = (a); i <= (b); i++)
#define per(i, a, b) for (int i = (a); i >= (b); i--)
#define endl '\n'
const int N = 2e5 + 5;

mt19937 mt(chrono::steady_clock::now().time_since_epoch().count());
int n, m;
char s[N];
int a[N];
void solve() {
  cin >> n;
  rep(i, 1, n) cin >> s[i];
  int l = 1;
  while (l <= n) {
    if (s[l] == '1') {
      a[l] = l;
      l++;
      continue;
    }
    int h = l + 1;
    while (h <= n && s[h] == '0') h++;
    if (h - l < 2) {
      cout << "NO" << endl;
      return;
    }
    rep(i, l, h - 2) a[i] = i + 1;
    a[h - 1] = l;
    l = h;
  }
  cout << "YES" << endl;
  rep(i, 1, n) cout << a[i] << ' ';
  cout << endl;
}
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  int t;
  cin >> t;
  while (t--) solve();
  return 0;
}